package com.xwltz.admin;

import com.xwltz.cache.annotation.EnabledCacheModule;
import com.xwltz.core.annotation.EnabledCoreModule;
import com.xwltz.core.config.AccessWarnings;
import com.xwltz.database.annotation.EnabledDatabaseModule;
import com.xwltz.rbac.annotation.EnabledAuthModule;
import com.xwltz.web.annotation.EnabledWebModule;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
import org.springframework.cache.annotation.EnableCaching;

/**
 * description: AdminApplication
 * information: on version 1.0 be created by @xwltz at 2021/12/28 11:13
 */

@EnabledCoreModule        // 启用核心包组件
@EnabledCacheModule       // 启用缓存包组件
//@EnabledCommonModule    // 启用通用包组件
@EnabledDatabaseModule    // 启用数据包组件
@EnabledAuthModule        // 启用权限包组件
@EnabledWebModule         // 启用Web组件吧
@EnableCaching            // 启用内存缓存
@SpringBootApplication    // 启用SpringBoot
@MapperScan("com.xwltz.admin.mapper")
public class AdminApplication {

	static {
		System.setProperty("druid.mysql.usePingMethod", "false");
	}

	public static void main(String[] args) {
		System.setProperty("spring.devtools.restart.enabled", "false");
		AccessWarnings.disableAccessWarnings(); // 忽略 非法反射警告
		SpringApplication application = new SpringApplication(AdminApplication.class);
		application.setApplicationStartup(new BufferingApplicationStartup(1024));
		application.run(args);
		System.out.println("==== framework admin 启动成功 =====");
		// System.out.println("token服务器启动成功！配置：" + SaManager.getConfig());
	}
}
